import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutView from '@/layout/index'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'init',
    redirect: '/index',
  },
  {
    path: "/index",
    name: "LayoutView",
    component: LayoutView,
    redirect: '/home',
    children: [
      {
        path: "/home",
        name: "Home",
        hidden: true,
        meta: { title: '首页' },
        component: () => import('@/views/home/Home'),
      },
      {
        path: "/proj-maintain",
        name: "ProjMaintain",
        hidden: true,
        meta: { title: '项目填报' },
        component: () => import('@/views/project/ProjMaintain'),
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
